﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NewStart
{
    class PointsHelper
    {
        delegate Rectangle d(Rectangle r);
        public static bool OutMenu(Point cursor, Control control)
        {
            try
            {
                Rectangle formrectangle = (Rectangle)control.Invoke(new d(control.RectangleToScreen), control.DisplayRectangle);
                if (!formrectangle.IntersectsWith(new Rectangle(cursor, new Size(1, 1))))
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
        }
    }
}
